<nz-card>
    <!-- 店铺状态 -->
    <nz-descriptions nzTitle="店铺状态" [nzColumn]="1">
        <nz-descriptions-item nzTitle="申请入口">{{ entranceText(detailsData?.source) }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="认证状态">{{ status_to_text(detailsData?.status) }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="审核时间">{{ detailsData?.auditTime || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="审核人">{{ detailsData?.auditor || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="审核备注">{{ detailsData?.auditReason || '-' }}</nz-descriptions-item>
    </nz-descriptions>

    <nz-divider></nz-divider>

    <!-- 联系人信息 -->
    <nz-descriptions nzTitle="联系人信息" [nzColumn]="1">
        <nz-descriptions-item nzTitle="联系人姓名">{{ detailsData?.orderPerson || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="手机号">{{ detailsData?.juridicalPhone || '-' }}</nz-descriptions-item>
    </nz-descriptions>

    <nz-divider></nz-divider>

    <!-- 门店信息 -->
    <nz-descriptions nzTitle="门店信息" [nzColumn]="1">
        <nz-descriptions-item nzTitle="门店名称">{{ detailsData?.storeName || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="统一社会信用代码">{{ detailsData?.uscc || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="执照注册日期">{{ detailsData?.businessRegisterTime || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="法人生日">{{ detailsData?.juridicalBirthday || '-' }}</nz-descriptions-item>
        <nz-descriptions-item nzTitle="性别">
            <ng-container [ngSwitch]="detailsData?.juridicalSex">
                <span *ngSwitchCase="0">未知</span>
                <span *ngSwitchCase="1">男</span>
                <span *ngSwitchCase="2">女</span>
                <span *ngSwitchDefault>-</span>
            </ng-container>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="经营范围">
            <nz-tag
                *ngFor="let item of detailsData?.service"
                nzColor="processing">
                {{ item }}
            </nz-tag>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="地址">
            {{ detailsData?.businessArea ? detailsData?.businessArea + ' ' + detailsData?.businessAddress : '-' }}
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="门店照片">
            <nz-image-group class="group-img-wrap">
                <span
                    class="content-img"
                    *ngFor="let data of detailsData?.companyImgs"
                >
                    <img
                        nz-image
                        nzSrc="{{ data }}"
                        [nzFallback]="fallback"
                    />
                </span>
            </nz-image-group>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="营业执照照片">
            <span class="content-img" *ngIf="detailsData?.businessImg">
                <img
                    nz-image
                    [nzSrc]="detailsData?.businessImg"
                    [nzFallback]="fallback"
                />
            </span>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="法人身份证正面">
            <span class="content-img" *ngIf="detailsData?.juridicalIdcardImgFront">
                <img
                    nz-image
                    [nzSrc]="detailsData?.juridicalIdcardImgFront"
                    [nzFallback]="fallback"
                />
            </span>
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="法人身份证反面">
            <span class="content-img" *ngIf="detailsData?.juridicalIdcardImgBack">
                <img
                    nz-image
                    [nzSrc]="detailsData?.juridicalIdcardImgBack"
                    [nzFallback]="fallback"
                />
            </span>
        </nz-descriptions-item>

        <nz-descriptions-item nzTitle="账号属性">
            <ng-container *ngIf="[0, 1, 2].includes(detailsData?.accountType); else elseSxTemplate">
                <nz-badge
                    [nzStatus]="detailsData?.accountType == 0 ? 'success' : 'error'"
                    [nzText]="detailsData?.accountType == 0 ? '正常' : (detailsData?.accountType == 1 ? '内部测试账号' : '内部同事推荐')"
                ></nz-badge>
            </ng-container>
            <ng-template #elseSxTemplate>-</ng-template>
            <!-- <div class="accatt-modify-wrap">
                <nz-radio-group nzSize="small" [(ngModel)]="accountAttribute">
                    <label nz-radio [nzValue]="0">正常</label>
                    <label nz-radio [nzValue]="1">测试</label>
                </nz-radio-group>

                <nz-divider nzType="vertical" class="accatt-sub"></nz-divider>
                <button
                    nz-button
                    nzType="primary"
                    nzSize="small"
                    nzShape="round"
                    class="accatt-sub"
                    [nzLoading]="subAccountLoaidng"
                    (click)="preserveAccount()">
                    保存
                </button>
            </div> -->
        </nz-descriptions-item>
        <nz-descriptions-item nzTitle="商家地图展示名称">
            {{ detailsData?.mapName || '-' }}
        </nz-descriptions-item>
    </nz-descriptions>

    <nz-divider></nz-divider>

    <div class="bt-box">
        <button
            nz-button
            nzType="primary"
            class="m-r-8"
            [disabled]="!detailsData || detailsData?.status != '2'"
            (click)="showAuditModal()">
            门店信息审核
        </button>
        <button
            *ngIf="[3, 4, 20].includes(detailsData?.status)"
            class="m-r-8"
            nz-button
            nzType="primary"
            [nzLoading]="resetStatusLoading"
            (click)="resetStatus()"
        >审核状态重置</button>
        <app-bt-group [btType]="'default'" [btText]="'返回'"></app-bt-group>

        <button
            nz-button
            nzType="primary"
            class="mbtn-green"
            (click)="showEditMapModal()"
        >商家地图属性修改</button>
    </div>
</nz-card>

<!-- S 商家地图属性修改Modal -->
<nz-modal
  nzClassName="custom-model-wrap"
  [nzFooter]="null"
  [(nzVisible)]="isMapVisible"
  [nzTitle]="'修改'"
  (nzOnCancel)="isMapVisible = false">

  <div *nzModalContent>
    <div class="custom-model-body">
        <form nz-form [formGroup]="validateMapForm">
            <nz-form-item>
                <nz-form-label nzSpan="7" nzRequired>商家地图展示名称</nz-form-label>
                <nz-form-control nzErrorTip="请输入商家地图展示名称!">
                    <input
                        nz-input
                        placeholder="请输入商家地图展示名称"
                        formControlName="mapName"
                    />
                </nz-form-control>
            </nz-form-item>

            <nz-form-item>
                <nz-form-label nzSpan="7" nzRequired>账号属性</nz-form-label>
                <nz-form-control nzErrorTip="请选择账号属性!">
                    <nz-radio-group formControlName="accountType">
                        <label nz-radio [nzValue]="0">正常</label>
                        <label nz-radio [nzValue]="1">内部测试账号</label>
                        <label nz-radio [nzValue]="2">内部同事推荐</label>
                    </nz-radio-group>
                </nz-form-control>
            </nz-form-item>
        </form>
    </div>

    <div class="custom-model-foot">
      <div class="custom-foot-cont">
        <button nz-button nzType="default" (click)="isMapVisible = false">取消</button>
        <button nz-button nzType="primary" [nzLoading]="submitMapLoading" (click)="submitMapForm()">确定</button>
      </div>
    </div>
  </div>
</nz-modal>
<!-- E 商家地图属性修改Modal -->

<nz-modal
    [(nzVisible)]="auditVisible"
    nzTitle="审核"
    [nzFooter]="null"
    (nzOnCancel)="handleCancel()">
    <ng-container *nzModalContent>
        <nz-form-item>
            <nz-form-label [nzSpan]="7">审核结果</nz-form-label>
            <nz-form-control [nzSpan]="17">
                <nz-radio-group
                    [(ngModel)]="auditParams.status"
                    (ngModelChange)="examineChange($event)">
                    <label nz-radio nzValue="3">通过</label>
                    <label nz-radio nzValue="4">不通过</label>
                </nz-radio-group>
            </nz-form-control>
        </nz-form-item>

        <ng-container *ngIf="auditParams.status === '3'">
            <nz-form-item>
                <nz-form-label [nzSpan]="7">统一社会信用代码</nz-form-label>
                <nz-form-control [nzSpan]="17">
                    <input nz-input placeholder="请输入统一社会信用代码" [(ngModel)]="auditParams.uscc" />
                </nz-form-control>
            </nz-form-item>

            <nz-form-item>
                <nz-form-label [nzSpan]="7">执照注册日期</nz-form-label>
                <nz-form-control [nzSpan]="17">
                    <nz-date-picker
                        [(ngModel)]="auditParams.businessRegisterTime"
                        (ngModelChange)="timeChange($event, 'businessRegisterTime')"
                    ></nz-date-picker>
                </nz-form-control>
            </nz-form-item>

            <nz-form-item>
                <nz-form-label [nzSpan]="7">法人生日</nz-form-label>
                <nz-form-control [nzSpan]="17">
                    <nz-date-picker
                        [(ngModel)]="auditParams.juridicalBirthday"
                        (ngModelChange)="timeChange($event, 'juridicalBirthday')"
                    ></nz-date-picker>
                </nz-form-control>
            </nz-form-item>

            <nz-form-item>
                <nz-form-label [nzSpan]="7" nzRequired>性别</nz-form-label>
                <nz-form-control [nzSpan]="17">
                    <nz-radio-group [(ngModel)]="auditParams.juridicalSex">
                        <label nz-radio [nzValue]="0">未知</label>
                        <label nz-radio [nzValue]="1">男</label>
                        <label nz-radio [nzValue]="2">女</label>
                    </nz-radio-group>
                </nz-form-control>
            </nz-form-item>

            <!-- <nz-form-item>
                <nz-form-label [nzSpan]="7" nzRequired>账号属性</nz-form-label>
                <nz-form-control [nzSpan]="17">
                    <nz-radio-group [(ngModel)]="auditParams.accountType">
                        <label nz-radio [nzValue]="0">正常</label>
                        <label nz-radio [nzValue]="1">测试</label>
                    </nz-radio-group>
                </nz-form-control>
            </nz-form-item> -->
        </ng-container>

        <nz-form-item>
            <nz-form-label [nzSpan]="7">备注</nz-form-label>
            <nz-form-control [nzSpan]="17">
                <textarea rows="6" nz-input [(ngModel)]="auditParams.auditReason" nzPlaceHolder="请输入备注"></textarea>
            </nz-form-control>
        </nz-form-item>

        <nz-form-item>
            <nz-form-control [nzOffset]="7">
                <button nz-button nzType="primary" class="m-r-8" (click)="closeFun()">确定</button>
                <button nz-button nzType="default" (click)="handleCancel()">取消</button>
            </nz-form-control>
        </nz-form-item>
    </ng-container>
</nz-modal>